I am trying to write a query to compare fields in two different MongoDB collections (same DB). Specifically, I have two collections that each contain a field that will match a portion of the time. I would, therefore, like to iterate through each row of each collection performing a comparison. When a match is found, I want to be able to perform a follow-on action (insert value of third field into one of the collections). A suggestion of syntax for this comparison query would be very helpful.
Thank you.